import { DETAL_API} from '../../api/url';
import http from '../../api/http';
export default{
    namespaced:true,
    state:{
        detail:[]
    },
    mutations:{
        setState(state,payload){
            state.detail=payload
        }
    },
    actions:{
        async requestDail(context,{id}){
            // console.log(id);
            const {data} = await http.get(DETAL_API,{movieId:id})
            // console.log(data.detailMovie);
            // const result= data.filter(item=>item.id==id)
            // console.log(result);
            context.commit('setState',data.detailMovie)
        }
    }
}